// AUTO GENERATED CODE!
// CODE GENERATOR WILL NOT PRESERVE MANUAL CHANGES TO THIS CODE!
// 

// MIT License (MIT)
// 
// Copyright (c) 2014 K Ercan Turkarslan
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
// 


using System;

namespace Mios.Generated.ServiceFiles
{
    // Generated from S_CameraMotionDetection1.xml
    
    public class CameraMotionDetection1Service : MiosService
    {
        #region Rows : Byte;
        private Byte? _mRows;
        
        public Byte Rows
        {
            get
            {
                return _mRows ?? GetRows();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetRows() : Byte;
        public Byte GetRows()
        {
            _mRows = FromLuupByte(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "Rows"));
            
            return _mRows.Value;
        }
        #endregion Action GetRows
        
        #endregion
        
        #region Columns : Byte;
        private Byte? _mColumns;
        
        public Byte Columns
        {
            get
            {
                return _mColumns ?? GetColumns();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetColumns() : Byte;
        public Byte GetColumns()
        {
            _mColumns = FromLuupByte(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "Columns"));
            
            return _mColumns.Value;
        }
        #endregion Action GetColumns
        
        #endregion
        
        #region ImageWidth : UInt16;
        private UInt16? _mImageWidth;
        
        public UInt16 ImageWidth
        {
            get
            {
                return _mImageWidth ?? GetImageWidth();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetImageWidth() : UInt16;
        public UInt16 GetImageWidth()
        {
            _mImageWidth = FromLuupUInt16(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ImageWidth"));
            
            return _mImageWidth.Value;
        }
        #endregion Action GetImageWidth
        
        #endregion
        
        #region ImageHeight : UInt16;
        private UInt16? _mImageHeight;
        
        public UInt16 ImageHeight
        {
            get
            {
                return _mImageHeight ?? GetImageHeight();
            }
        }
        
        // WARNING: Service Description File does not contain any Get Action with a
        // argument related to this State Variable.
        // 
        // This may be due to a typo while defining the Get Action or state variable.
        // This may also be intentional. Code generator assumes this was a mistake and
        // generates this Get Action.
        
        #region Action GetImageHeight() : UInt16;
        public UInt16 GetImageHeight()
        {
            _mImageHeight = FromLuupUInt16(Engine.Luup_VariableGet(base.DeviceId, base.ServiceId, "ImageHeight"));
            
            return _mImageHeight.Value;
        }
        #endregion Action GetImageHeight
        
        #endregion
        
        
        #region Action SetPriorities(String priorities)
        public void SetPriorities(String priorities)
        {
            if (String.IsNullOrEmpty(priorities))
                throw new ArgumentNullException("priorities");
            
            Engine.Luup_CallAction(base.DeviceId, base.ServiceId, "SetPriorities"
                , String.Format("priorities={0}", ToLuup(priorities))
                ); // Engine.Luup_CallAction
        }
        #endregion Action SetPriorities
        
        
        #region Method SetVariable(String name, String value) : Boolean;
        internal override Boolean SetVariable(String name, String value)
        {
            switch(name)
            {
                case "Columns":
                    _mColumns = FromLuupByte(value); return true;
                case "ImageHeight":
                    _mImageHeight = FromLuupUInt16(value); return true;
                case "ImageWidth":
                    _mImageWidth = FromLuupUInt16(value); return true;
                case "Rows":
                    _mRows = FromLuupByte(value); return true;
                default:
                    return false;
            }
        }
        #endregion Method SetVariable
        
        public CameraMotionDetection1Service(MiosEngine engine, UInt32 deviceId, String serviceId)
            : base(engine, deviceId, serviceId)
        {
            
        } //End Constructor
    } //End of class
} //End of Namespace

